<template>
  <div class="form-switch">
    <a-switch v-model="formData[name]" :disabled="disabled" size="small" />
  </div>
</template>
<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'

@Component
export default class FormSwitch extends Vue {
  @Prop() name!: any // key
  @Prop({ type: Boolean, default: false }) disabled!: boolean
  @Prop({ type: Object, default: () => ({}) }) formData!: { [key: string]: any }
}
</script>
<style lang="less" scoped>
.form-switch {
  display: flex;
  padding: 8px;
  width: 100%;
}
</style>
